home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / launch / Makefile < prev    next >
Encoding:
Makefile  |  1997-08-18  |  1.2 KB  |  47 lines  |  [TEXT/R*ch]

  1. # Unix Makefile for launching Moscow ML
  2. # Based on the Caml Light (copyright 1993 INRIA)
  3.  
  4. include ../Makefile.inc
  5.  
  6. all: mosmlc mosml camlexec testprog 
  7.  
  8. # header cannot be generated until camlrunm is installed in $(BINDIR)...
  9.  
  10. install:
  11.     (echo "#!$(BINDIR)/camlrunm"; \
  12.      echo "exit 2"; \
  13.      cat testprog) > /tmp/testscr
  14.     chmod a+x /tmp/testscr
  15.     sh -c 'if sh -c /tmp/testscr 2>/dev/null; \
  16.                then echo "#!$(BINDIR)/camlrunm" > $(LIBDIR)/header; \
  17.                else cp camlexec $(LIBDIR)/header; \
  18.                fi'
  19.     rm -f /tmp/testscr
  20.     for script in mosml mosmlc; do \
  21.       cp $$script $(BINDIR)/$$script; \
  22.       chmod a+x $(BINDIR)/$$script; \
  23.     done
  24.  
  25. mosmlc: mosmlc.tpl
  26.     sed -e "s|LIBDIR|$(LIBDIR)|" -e "s|BINDIR|$(BINDIR)|" mosmlc.tpl > mosmlc
  27.  
  28. mosml: mosml.tpl
  29.     sed -e "s|LIBDIR|$(LIBDIR)|" -e "s|BINDIR|$(BINDIR)|" mosml.tpl > mosml
  30.  
  31. testprog: testprog.sml
  32.     $(MOSMLC) testprog.sml
  33.     $(MOSMLL) -noheader -o testprog BasicIO.uo testprog.uo
  34.  
  35. camlexec.c: camlexec.tpl
  36.     sed -e "s|LIBDIR|$(LIBDIR)|" -e "s|BINDIR|$(BINDIR)|" camlexec.tpl > camlexec.c
  37.  
  38. camlexec: camlexec.c
  39.     $(CC) $(OPTS) -o camlexec camlexec.c
  40.     $(STRIP) camlexec
  41.  
  42. clean:
  43.     rm -f camlexec.c camlexec mosmlc mosml testprog testprog.u[io]
  44.  
  45. depend:
  46.  
  47.